p $tmp=0
while $tmp<$cpu_number
  eval "tvariable $per_cpu_c_%d",$tmp
  eval "tvariable $per_cpu_cy_%d",$tmp
  eval "tvariable $per_cpu_cy2_%d",$tmp
  eval "tvariable $per_cpu_tmp_0_%d",$tmp
  p $tmp=$tmp+1
end

trace e1000_poll
  commands
    teval $per_cpu_c_0=$per_cpu_c_0+1
    teval $per_cpu_tmp_0_0=$clock
  end
list e1000_poll
trace 2949 if ($per_cpu_c_0>100)
  commands
    teval $per_cpu_cy_0=$clock-$per_cpu_tmp_0_0+$per_cpu_cy_0
    teval $per_cpu_tmp_0_0=$clock
  end
list e1000_poll
trace 2964   if ($per_cpu_c_0>100)
  commands
    teval $per_cpu_cy2_0=$clock-$per_cpu_tmp_0_0+$per_cpu_cy2_0
  end


define showall
p $tmp=0
p $all1=0
p $all2=0
while $tmp<$cpu_number
  eval "p $per_cpu_cy_%d/($per_cpu_c_%d-100)",$tmp,$tmp
  eval "p $all1=$all1+$per_cpu_cy_%d/($per_cpu_c_%d-100)",$tmp,$tmp
  eval "p $per_cpu_cy2_%d/($per_cpu_c_%d-100)",$tmp,$tmp
  eval "p $all2=$all2+$per_cpu_cy2_%d/($per_cpu_c_%d-100)",$tmp,$tmp
  p $tmp=$tmp+1
end
p $all1/$cpu_number
p $all2/$cpu_number
end

